﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IPagedList<Product>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Test
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Test</h2>

    <table>
        <tr>
            <th></th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
               <%: item.Name %>
            </td>
            <td>
               <%: item.Category.Name %>
            </td>
            <td>
                <%: Html.ActionLink("Delete", "Delete", new  { id= item.Id })%>        
            </td>
             <td>
                <%: Html.ActionLink("Update", "Update", new  { id= item.Id })%>        
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%: Html.ActionLink("Create New", "Add") %>
    </p>

    <p>
        <% var obj = ViewData["Testcase"] as EF4.Model.Entities.Category; %>
        <%: obj.Name%> <br /><br />

        <%: obj.ChildCategories.Count%>
        <%: obj.Products.Count%>
    </p>
</asp:Content>

